1 /*
2  * Copyright (c) 2011-2014 - Mauro Carvalho Chehab
3  * Copyright (c) 2012 - Andre Roth <neolynx@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation version 2.1 of the License.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
18  *
19  */
20 
21 /**
22  * @file desc_language.h
23  * @ingroup descriptors
24  * @brief Provides the descriptors for the ISO639 language descriptor
25  * @copyright GNU Lesser General Public License version 2.1 (LGPLv2.1)
26  * @author Mauro Carvalho Chehab
27  * @author Andre Roth
28  *
29  * @par Relevant specs
30  * The descriptor described herein is defined at:
31  * - ISO/IEC 13818-1
32  *
33  * @par Bug Report
34  * Please submit bug reports and patches to linux-media@vger.kernel.org
35  */
36 
37 module libdvbv5_d.desc_language;
38 
39 import libdvbv5_d.descriptors: dvb_desc;
40 import libdvbv5_d.dvb_fe: dvb_v5_fe_parms;
41 
42 extern (C):
43 
44 /**
45  * @struct dvb_desc_language
46  * @ingroup descriptors
47  * @brief Structure containing the ISO639 language descriptor
48  *
49  * @param type			descriptor tag
50  * @param length		descriptor length
51  * @param next			pointer to struct dvb_desc
52  * @param language		ISO639 language string
53  * @param audio_type		audio type: 0 = undefined, 1 = clean effects,
54  *				2 = hearing impaired, 3 = visual impired
55  *				comentary, other values are reserved.
56  */
57 struct dvb_desc_language
58 {
59     align (1):
60 
61     ubyte type;
62     ubyte length;
63     dvb_desc* next;
64 
65     ubyte[4] language;
66     ubyte audio_type;
67 }
68 
69 // struct dvb_v5_fe_parms;
70 
71 /**
72  * @brief Initializes and parses the language descriptor
73  * @ingroup descriptors
74  *
75  * @param parms	struct dvb_v5_fe_parms pointer to the opened device
76  * @param buf	buffer containing the descriptor's raw data
77  * @param desc	pointer to struct dvb_desc to be allocated and filled
78  *
79  * This function initializes and makes sure that all fields will follow the CPU
80  * endianness. Due to that, the content of the buffer may change.
81  *
82  * Currently, no memory is allocated internally.
83  *
84  * @return On success, it returns the size of the allocated struct.
85  *	   A negative value indicates an error.
86  */
87 int dvb_desc_language_init (
88     dvb_v5_fe_parms* parms,
89     const(ubyte)* buf,
90     dvb_desc* desc);
91 
92 /**
93  * @brief Prints the content of the language descriptor
94  * @ingroup descriptors
95  *
96  * @param parms	struct dvb_v5_fe_parms pointer to the opened device
97  * @param desc	pointer to struct dvb_desc
98  */
99 void dvb_desc_language_print (dvb_v5_fe_parms* parms, const(dvb_desc)* desc);